<div>
    <fieldset>
        <legend>Читатель</legend>

        <?php echo $this->ReaderInfo()->ToHtml(); ?>
        <input type="hidden" id="ReaderId" value="<?php echo $this->data['user_id']; ?>"/>

        <div class="Collapsible">
            <div><a href="?" class="Control" id="OrderCollaps">Заказы ▲</a></div>
            <div class="Line"></div>
            <div id="ReaderOrders" class="Hide"><?php echo $this->Orders()->ToHtml(); ?></div>
        </div>

        <div class="Collapsible">
            <div><a href="?" class="Control" id="IssueCollaps">На руках ▲</a></div>
            <div class="Line"></div>
            <div id="ReaderIssues" class="Hide"><?php echo $this->Issues()->ToHtml(); ?></div>
        </div>

    </fieldset>

    <script type="text/javascript">
        jsun.run(function() {
        //////////////////////////////////////////////////////

        jsun("#AltReader").jsun.event({ onclick: AltReader });
        jsun("#OrderCollaps").jsun.event({ onclick: CollapseOrders });
        jsun("#IssueCollaps").jsun.event({ onclick: CollapseIssues });

        jsun.swap.ORDER_LIST_HIDE = true;
        jsun.swap.ISSUE_LIST_HIDE = true;


        function Editions() {
        }

        function GetReaderOrders() {
        }

        function AltReader() {
            var dlg = new jsun.dialog({ title: "Изменение профиля" });
            jsun.html.insert(dlg.content.v, jsun.html.sync_load("u=Lib&m=Lib\\Reader/Alt&user_id="
                + jsun("#ReaderId").value))
            return dlg.show();
        }

        function CollapseOrders() {
            var content = jsun('#ReaderOrders');
            if (jsun.swap.ORDER_LIST_HIDE) {
                this.replaceChild(document.createTextNode('Заказы ▼'), this.firstChild);
                content.setAttribute('class', '');
                jsun.swap.ORDER_LIST_HIDE = false;
            } else {
                this.replaceChild(document.createTextNode('Заказы ▲'), this.firstChild);
                content.setAttribute('class', 'Hide');
                jsun.swap.ORDER_LIST_HIDE = true;
            }
        }

        function CollapseIssues() {
            var content = jsun('#ReaderIssues');
            if (jsun.swap.ISSUE_LIST_HIDE) {
                this.replaceChild(document.createTextNode('На руках ▼'), this.firstChild);
                content.setAttribute('class', '');
                jsun.swap.ISSUE_LIST_HIDE = false;
            } else {
                this.replaceChild(document.createTextNode('На руках ▲'), this.firstChild);
                content.setAttribute('class', 'Hide');
                jsun.swap.ISSUE_LIST_HIDE = true;
            }
        }

        ///////////////////////////////////////////////////////
        });
    </script>
</div>